﻿using System;
using System.Collections.Generic;
using UnityEngine;

// Token: 0x020002FA RID: 762
public class FindAssist
{
	// Token: 0x17000296 RID: 662
	// (get) Token: 0x060012A5 RID: 4773 RVA: 0x00097A04 File Offset: 0x00095C04
	// (set) Token: 0x060012A6 RID: 4774 RVA: 0x00097A0C File Offset: 0x00095C0C
	public Dictionary<string, GameObject> dictObjName { get; private set; }

	// Token: 0x17000297 RID: 663
	// (get) Token: 0x060012A7 RID: 4775 RVA: 0x00097A18 File Offset: 0x00095C18
	// (set) Token: 0x060012A8 RID: 4776 RVA: 0x00097A20 File Offset: 0x00095C20
	public Dictionary<string, List<GameObject>> dictTagName { get; private set; }

	// Token: 0x060012A9 RID: 4777 RVA: 0x00097A2C File Offset: 0x00095C2C
	public virtual void Initialize(Transform trf)
	{
		this.dictObjName = new Dictionary<string, GameObject>();
		this.dictTagName = new Dictionary<string, List<GameObject>>();
		this.FindAll(trf);
	}

	// Token: 0x060012AA RID: 4778 RVA: 0x00097A4C File Offset: 0x00095C4C
	public virtual void FindAll(Transform trf)
	{
		if (!this.dictObjName.ContainsKey(trf.name))
		{
			this.dictObjName[trf.name] = trf.gameObject;
		}
		string tag = trf.tag;
		if (string.Empty != tag)
		{
			List<GameObject> list = null;
			if (!this.dictTagName.TryGetValue(tag, out list))
			{
				list = new List<GameObject>();
				this.dictTagName[tag] = list;
			}
			list.Add(trf.gameObject);
		}
		for (int i = 0; i < trf.childCount; i++)
		{
			this.FindAll(trf.GetChild(i));
		}
	}

	// Token: 0x060012AB RID: 4779 RVA: 0x00097AF8 File Offset: 0x00095CF8
	public virtual GameObject GetObjectFromName(string objName)
	{
		if (this.dictObjName == null)
		{
			return null;
		}
		GameObject result = null;
		this.dictObjName.TryGetValue(objName, out result);
		return result;
	}

	// Token: 0x060012AC RID: 4780 RVA: 0x00097B24 File Offset: 0x00095D24
	public virtual List<GameObject> GetObjectFromTag(string tagName)
	{
		if (this.dictTagName == null)
		{
			return null;
		}
		List<GameObject> result = null;
		this.dictTagName.TryGetValue(tagName, out result);
		return result;
	}
}
